<?php 
	require_once("obj/user.php");
	$msg = "";
	if(isset($_POST["txtEmail"])){
		$email = $_POST["txtEmail"];		
		if($email != null && $email != ""){		
			$ok = User::emailPwd($email);
			if($ok){ $msg = "Email sent"; }
			else { $msg = "Email could not be sent, please make sure you entered the correct email address and try again"; }
		}
	}
?>

<form method="post" action="index.php?page=forgot">
<?php 
	if($msg != "") {
		echo '<div class="error">'.$msg.'</div>';		
	}
?>
<table cellpadding="5" cellspacing="0">
	<tr>
		<td>Email:</td>
		<td><input id="txtEmail" name="txtEmail" type="text" /></td>
	</tr>
	<tr>
		<td><input type="submit" value="Submit" /></td>
		<td><input type="button" value="Cancel" onclick="javascript:window.location='index.php';" /></td>
	</tr>
</table>